<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<%--
  Created by IntelliJ IDEA.
  User: 凡人
  Date: 2021/11/29
  Time: 10:27
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <!--视口 自适应-->
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>title</title>
    <link href="${pageContext.request.contextPath}/static/css/bootstrap.css" rel="stylesheet">
    <script src="${pageContext.request.contextPath}/static/js/jquery-3.2.1.js" rel="script"></script>
    <script src="${pageContext.request.contextPath}/static/js/bootstrap.js" rel="script"></script>
    <script src="${pageContext.request.contextPath}/static/My97DatePicker/WdatePicker.js" rel="script"></script>

</head>
<body>
<form action="" method="post">
    发布时间:<input readonly="readonly" type="text" onclick="WdatePicker()" name="startDate"
                value="<fmt:formatDate value="${d.startDate}" pattern="yyyy-MM-dd"></fmt:formatDate> "> 至
            <input readonly="readonly" type="text" onclick="WdatePicker()" name="endDate"
                   value="<fmt:formatDate value="${d.endDate}" pattern="yyyy-MM-dd"></fmt:formatDate>">
    <select name="field1">
        <option value="">请选择</option>
        <option value="user" ${d.field1=="user"?'selected':''}>制作人</option>
        <option value="auditor" ${d.field1=="auditor"?'selected':''}>审核人</option>
    </select>
    <input type="text" name="con"><br><br>
    <select name="field2">
        <option value="">请选择</option>
        <option value="main_version" ${d.field2=="main_version"?'selected':''}>主版本号</option>
        <option value="form_version" ${d.field2=="form_version"?'selected':''}>从版本号</option>
    </select>
    <input type="text" name="startCon" value="${d.startCon}"> 至
    <input type="text" name="endCon" value="${d.endCon}">
    <input type="button" value="查询" id="but" onclick="goPage(1)">
    <a href="javascript:void(0)" onclick="rank('addtime')">发布时间</a>
    <a href="javascript:void(0)" onclick="rank('main_version')">主版本号</a>
    <a href="javascript:void(0)" onclick="rank('form_version')">从版本号</a>
    <input type="hidden" name="rank" value="${d.rank}">
    <input type="hidden" name="f" value="${d.f}">

</form>
<table class="table">
    <thead>
    <tr>
        <th scope="col">发布时间</th>
        <th scope="col">品牌</th>
        <th scope="col">品类</th>
        <th scope="col">产品编号</th>
        <th scope="col">主版本号</th>
        <th scope="col">从版本号</th>
        <th scope="col">制图文件</th>
        <th scope="col">总用量</th>
        <th scope="col">制作人</th>
        <th scope="col">审核人</th>
        <th scope="col">备注</th>
    </tr>
    </thead>
    <tbody>
    <c:forEach var="i" items="${list.list}">
        <tr>
            <td>
                <fmt:formatDate value="${i.addtime}" pattern="yyyy-MM-dd"></fmt:formatDate>
            </td>
            <td>${i.brand}</td>
            <td>${i.type}</td>
            <td>${i.code}</td>
            <td>${i.mainVersion}</td>
            <td>${i.formVersion}</td>
            <td>
                <img src="${i.image}" width="50px" height="50px">
            </td>
            <td>${i.totalAmount}</td>
            <td>${i.user.user}${i.user.id}</td>
            <td>${i.auditor}</td>
            <td>${i.content}</td>
            <td>
                <a href="javascript:void(0)" onclick="delete(${i.id})">删除</a>
            </td>
        </tr>
    </c:forEach>
    <tr>
        <td colspan="100">
            <jsp:include page="/static/common/pages.jsp"></jsp:include>
        </td>
    </tr>
    </tbody>
</table>
</body>
<script>
    function rank(str){
        var i = $("[name='rank']").val()%2+1;
        $("[name='rank']").val(i);
        $("[name='f']").val(str);
        goPage(1);
    }
</script>
</html>
